<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
    
    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.common.key.js" ></script>
    <script src="../libraries/RGraph.pie.js" ></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->

    <title>A Pie chart that shows movie genre popularity</title>     
</head>
<body>

    <h1>A Pie chart that shows movie genre popularity</h1>

    <canvas id="cvs" width="550" height="325">[No canvas support]</canvas>
    
    <script>
        $(document).ready(function ()
        {
            var data = [365555,363959,354964,341772,531421,475698,465630,458739,438358,437585,435162,427067,422607,421752,372254];
            
            // The labels
            var labels = ['Childrens','Classics','Travel','Music','Sports ','Sci-Fi','Animation','Drama','Comedy','Action','New','Games','Foreign','Family','Documentary','Horror'];


            // Create the Pie chart object
            var pie = new RGraph.Pie({
                id: 'cvs',
                data: data
            })

            // Append the number to the labels
            for (var i=0; i<data.length; ++i) {
                labels[i] = labels[i] + ' ' + RGraph.numberFormat(pie, data[i]);
            }

            pie.set({
                labels: labels,
                strokestyle: 'white',
                linewidth: 1
            }).draw()
        })
    </script>

    <p>        
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>